#ifndef DATA_STORAGE_BASE_H
#define DATA_STORAGE_BASE_H

#include <stdint.h>
#include <module_header_reg.h>

#define DATA_STORAGE_EOF 0x55AA

typedef struct 
{
    union
    {
        struct
        {
            uint8_t _AA;
            uint8_t _55;
        };
        uint16_t value;
    };
}data_storage_eof_t;

typedef struct 
{
    uint8_t* data;
    uint8_t size;
}data_storage_reg_read_t;

class DataStorageBase
{
public:
    virtual  ~DataStorageBase()=default;
    virtual void begin() = 0;
    virtual void make_default()= 0;
    virtual bool load() = 0;
    virtual data_storage_reg_read_t& get_reg_data(uint8_t reg_address) = 0;
    virtual int read_data_storage_eof()=0;
    virtual module_header_reg_t& module_header_reg() = 0;
    virtual  void check_update() =0;
};

#endif